#!/bin/bash
apt update && apt upgrade -y && apt autoremove -y
[ $? -ne 0 ] && echo "更新失败" | mail -s "系统更新报告" admin@example.com